package com.dxt.dao;

import com.dxt.model.CommonKeyValueBean;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public interface CommonDao {

    @Select("SELECT t.code,t.value FROM dxt_sys_config t where t.is_delete = 0 ")
    @Results({
            @Result(property = "code", column = "code"),
            @Result(property = "value", column = "value")
    })
    List<CommonKeyValueBean> getSysConfigBeanList();

    @Update("update dxt_sys_config a set a.value = #{value} where a.code = #{code}")
    void updateSysConfigValue(String code,String value);

    @Select("SELECT t.OPEN_ID code,t.OPEN_SECRETKEY value FROM dxt_secret_key t where t.is_delete = 0 ")
    @Results({
            @Result(property = "code", column = "code"),
            @Result(property = "value", column = "value")
    })
    List<CommonKeyValueBean> getSecretKeyList();

}
